//
//  CalendarCollectionReusableView.m
//  TodatPlay
//
//  Created by dllo on 16/9/12.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "CalendarCollectionReusableView.h"
#import "SZCalendarPicker.h"

@interface CalendarCollectionReusableView ()

@property (nonatomic, copy) calendarBlock calendar;
@property (nonatomic, copy) clickCalendar clickCalendar;
@end

@implementation CalendarCollectionReusableView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        SZCalendarPicker *calendarPicker = [SZCalendarPicker showOnView:self];
        calendarPicker.today = [NSDate date];
        calendarPicker.date = calendarPicker.today;
        calendarPicker.frame = CGRectMake(0, 0, self.frame.size.width, 250);
        calendarPicker.calendarBlock = ^(NSInteger day, NSInteger month, NSInteger year) {

            
            self.calendar(day ,month, year);
        };
        calendarPicker.clickCalendar = ^(NSInteger day, NSInteger month, NSInteger year) {
            self.clickCalendar(day, month, year);
        };
        

    }
    return self;
}
- (void)click:(calendarBlock)calendar {
    self.clickCalendar = calendar;
}
- (void)calendar:(calendarBlock)calendar {
    self.calendar = calendar;
}
@end
